<?php

namespace App\Services\Account;

use Illuminate\Database\Eloquent\Relations\HasMany;

class AccountFans extends AccountAbstract
{
    protected function account(): HasMany
    {
        return $this->user->userFans();
    }

    /*---------- plus --------------------------------------------------------------------------------------------------*/

    public function plusFans($fans,$data = [])
	{
		$fans = big_decimal($fans);
		$this->record($fans, 'own_fans', '粉丝添加', $data);
	}

	



	/*---------- minus -------------------------------------------------------------------------------------------------*/

	public function minusGiftApples($apples, $data = [],$name)
	{
		$apples = big_decimal($apples)->multipliedBy(-1);
		$this->record($apples, 'gift_apples', '赠送给'.$name, $data);
	}

	public function minusApplesExchangeBalances($apples, $data = [])
	{
		$apples = big_decimal($apples)->multipliedBy(-1);
		$this->record($apples, 'apples_exchange_balances', '苹果兑换红包', $data);
	}

	public function minusAppleExchangeTrees($apples, $data = [])
	{
		$apples = big_decimal($apples)->multipliedBy(-1);
		$this->record($apples, 'apple_exchange_trees', '苹果兑换变异树', $data);
	}

	public function minusAppleExchangeOrders($apples, $data = [])
	{
		$apples = big_decimal($apples)->multipliedBy(-1);
		$this->record($apples, 'apple_exchange_order', '苹果兑换商品', $data);
	}
	

	public function minusSystemRecallApples($apples, $data = [])
	{
		$apples = big_decimal($apples)->multipliedBy(-1);
		$this->record($apples, 'system_recall', '系统回收', $data);
	}


	
}
